Skip to content
This repository has been archived by the owner on Sep 26, 2018. It is now read-only.

Subscriber balance zero out when validity expire (Client dependent) #42

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

shivkumarsah
Copy link
Contributor

Please review subscriber balance zero out feature:

This PR is linked with #40

Copy link
Contributor

@kkroo kkroo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how has this been tested?

credit_balance = crdt.PNCounter("default").serialize()
print "Validity expired for Susbcribers %s setting balance to 0" % (
[subscriber.imsi for subscriber in subscribers],)
subscribers.update(crdt_balance=credit_balance)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just update the value to zero?

valid_through__lte=today)
if not subscribers:
return # Do nothing
credit_balance = crdt.PNCounter("default").serialize()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you don't need to deal with crdt's. You can use the getter/setter Subscriber property balance

@shivkumarsah shivkumarsah changed the title Subscriber balance zero out when validity expire - DO NOT MERGE Subscriber balance zero out when validity expire (Client dependent) Aug 4, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants